home *** CD-ROM | disk | FTP | other *** search
/ Hardcore Gamer Resource Kit / Hardcore Gamer Resource Kit - Disc 2.iso / Utils / UNIX / UNZIP520 / MSDOS / DOSCFG.H < prev    next >
C/C++ Source or Header  |  1996-04-24  |  4KB  |  128 lines

  1. /*---------------------------------------------------------------------------
  2.     MS-DOS specific configuration section:
  3.   ---------------------------------------------------------------------------*/
  4.  
  5. #ifndef __doscfg_h
  6. #define __doscfg_h
  7.  
  8. #include <dos.h>           /* for REGS macro (TC) or _dos_setftime (MSC) */
  9.  
  10. #ifdef __TURBOC__          /* includes Power C */
  11. #  include <sys/timeb.h>   /* for structure ftime */
  12. #  ifndef __BORLANDC__     /* there appears to be a bug (?) in Borland's */
  13. #    include <mem.h>       /*  MEM.H related to __STDC__ and far poin-   */
  14. #  endif                   /*  ters. (dpk)  [mem.h included for memcpy]  */
  15. #endif
  16.  
  17. #ifdef MSWIN
  18. #  if (defined(MSC) || defined(__WATCOMC__))
  19. #    include <sys/utime.h>
  20. #  else /* !(MSC || __WATCOMC__) ==> may be BORLANDC, or GNU environment */
  21. #    include <utime.h>
  22. #  endif /* ?(MSC || __WATCOMC__) */
  23. #endif
  24.  
  25. #ifdef __WATCOMC__
  26. #  ifdef __386__
  27. #    ifndef WATCOMC_386
  28. #      define WATCOMC_386
  29. #    endif
  30. #    define __32BIT__
  31. #    undef far
  32. #    define far
  33. #    undef near
  34. #    define near
  35.  
  36. /* Get asm routines to link properly without using "__cdecl": */
  37. #    ifndef USE_ZLIB
  38. #      pragma aux crc32         "_*" parm caller [] value [eax] modify [eax]
  39. #      pragma aux get_crc_table "_*" parm caller [] value [eax] \
  40.                                       modify [eax ecx edx]
  41. #    endif /* !USE_ZLIB */
  42. #  else /* !__386__ */
  43. #    ifndef USE_ZLIB
  44. #      pragma aux crc32         "_*" parm caller [] value [ax dx] \
  45.                                       modify [ax cx dx bx]
  46. #      pragma aux get_crc_table "_*" parm caller [] value [ax] \
  47.                                       modify [ax cx dx bx]
  48. #    endif /* !USE_ZLIB */
  49. #  endif /* ?__386__ */
  50.  
  51. #  ifndef EPIPE
  52. #    define EPIPE -1
  53. #  endif
  54. #  define PIPE_ERROR (errno == EPIPE)
  55. #endif /* __WATCOMC__ */
  56.  
  57. #ifdef __EMX__
  58. #  ifndef __32BIT__
  59. #    define __32BIT__
  60. #  endif
  61. #  define far
  62. #endif
  63.  
  64. #if defined(__GO32__) || defined(__DJGPP__)    /* MS-DOS compiler, not OS/2 */
  65. #  ifndef __32BIT__
  66. #    define __32BIT__
  67. #  endif
  68. #  ifndef __GO32__
  69. #    define __GO32__
  70. #  endif
  71. #  include <sys/timeb.h>      /* for structure ftime */
  72. #  if (defined(__DJGPP__) && (__DJGPP__ > 1))
  73. #    include <unistd.h>       /* for prototypes for read/write etc. */
  74. #    include <dir.h>          /* for FA_LABEL */
  75. #  else
  76.      int setmode(int, int);   /* not in older djgpp's include files */
  77. #  endif
  78. #endif
  79.  
  80. #ifndef __32BIT__
  81. #  define __16BIT__
  82. #endif
  83.  
  84. #if (defined(M_I86CM) || defined(M_I86LM)) || defined(MSWIN)
  85. #  define MED_MEM
  86. #endif
  87. #if (defined(__COMPACT__) || defined(__LARGE__) || defined(__HUGE__))
  88. #  define MED_MEM
  89. #endif
  90. #ifdef __16BIT__
  91. #  ifndef MED_MEM
  92. #    define SMALL_MEM
  93. #  endif
  94. #endif
  95.  
  96. #define EXE_EXTENSION ".exe"  /* OS/2 has GetLoadPath() function instead */
  97.  
  98. #ifdef __16BIT__
  99. # if defined(MSC) || defined(__WATCOMC__)
  100. #   include <malloc.h>
  101. #   define nearmalloc _nmalloc
  102. #   define nearfree _nfree
  103. # endif
  104. # if defined(__TURBOC__) && defined(DYNALLOC_CRCTAB)
  105. #   if defined(__COMPACT__) || defined(__LARGE__) || defined(__HUGE__)
  106. #     undef DYNALLOC_CRCTAB
  107. #   endif
  108. # endif
  109. # ifndef nearmalloc
  110. #   define nearmalloc malloc
  111. #   define nearfree free
  112. # endif
  113. # if defined(USE_ZLIB) && !defined(USE_OWN_CRCTAB)
  114. #   define USE_OWN_CRCTAB
  115. # endif
  116. #endif
  117.  
  118. #define NOVELL_BUG_WORKAROUND   /* another stat()/fopen() bug with some 16-bit
  119.                                  *  compilers on Novell drives; very dangerous
  120.                                  *  (silently overwrites executables in other
  121.                                  *  directories)  */
  122. #define NOVELL_BUG_FAILSAFE     /* enables additional test & message code
  123.                                  *  that directs UnZip to fail safely in case
  124.                                  *  the "workaround" enabled above does not
  125.                                  *  work as intended.  */
  126.  
  127. #endif /* !__doscfg_h */
  128.